/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-12-13     GC       the first version
 */
#include "key.h"

struct key_s
{
    uint8_t S2;
    uint8_t S3;
    uint8_t S4;
};//定义一个RGB结构体

struct key_s key;

void Key_INIT(void)
{
    key.S2 = rt_pin_get("PF.1");
    key.S3 = rt_pin_get("PF.0");
    key.S4 = rt_pin_get("PA.2");
    //上拉输入

    rt_pin_mode(key.S2, PIN_MODE_INPUT_PULLUP);
    rt_pin_mode(key.S3, PIN_MODE_INPUT_PULLUP);
    rt_pin_mode(key.S4, PIN_MODE_INPUT_PULLUP);
}

int Read_S2(void){
    return rt_pin_read(key.S2);
}

int Read_S3(void){
    return rt_pin_read(key.S3);
}

int Read_S4(void){
    return rt_pin_read(key.S4);
}





